package com.zhentao.file.config;

import io.minio.MinioClient;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

import javax.annotation.Resource;

/**
 * @author 王瑞杰
 * date 2024/5/9
 */
@EnableConfigurationProperties(MinioConfigProperties.class)
public class MinioConfig {
    @Resource
    private MinioConfigProperties minioConfigProperties;
    @Bean
    public MinioClient minioClient(){
        return MinioClient.builder().credentials(minioConfigProperties.getAccessKey(), minioConfigProperties.getSecretKey()).endpoint(minioConfigProperties.getEndpoint()).build();
    }
}
